@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Onest:wght@300;500&display=swap');

:root {
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

html {
    font-size: 16px;
    font-family: "Amatic SC", sans-serif;
    font-weight: 400;
    color: #fff;
}

body {
    background-color: rgba(0, 0, 0, 0.5);
}

body, html {
    margin: 0;
}

body {
    width: 100%;
}

.panels {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 0 .8rem .5rem rgba(0, 0, 0, 0.5);
    color: #fff;
    text-align: center;
    align-items: center;
    transition:
        flex .5s cubic-bezier(.61,-0.19,.7,-0.11),
        background-size .2s linear,
        background-position .2s linear;
    background-size: cover;
    background-position: center;
    flex: 1 1;
    font-size: 2rem;
}

.panel__1 { background-image: url(./source/image/bg/lets-dance.jpg); }
.panel__2 { background-image: url(./source/image/bg/give-take-receive.jpg); }
.panel__3 { background-image: url(./source/image/bg/experience.jpg); }
.panel__4 { background-image: url(./source/image/bg/all.jpg); }
.panel__5 { background-image: url(./source/image/bg/moment.jpg); }

.panel p {
    display: block;
    flex: 1;
    width: 100%;
    text-align: center;
    padding: 25% 0 0;
    margin: 0;
    transition: 
        transform .2s,
        font-size .4s cubic-bezier(.61,-0.19,.7,-0.11)
    ;
}

.panel p:first-child {
    transform: translateY(-100%);
}

.panel p:last-child {
    transform: translateY(100%);
}

.panel.active {
    flex: 2;
}

.panel.open-text p:first-child,
.panel.open-text p:last-child {
    transform: translate(0);
}

.panel:hover p:nth-child(2),
.panel.active p:nth-child(2) {
    font-size: 5rem;
}